package com.anche.cywebnew.Controller.businessManager;

import com.anche.cywebnew.Pojo.businessManager.CyDataOBDInfo;
import com.anche.cywebnew.Service.businessManager.CyDataOBDService;
import com.anche.cywebnew.Utils.result.ResultUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("/business/cyOBD")
public class CyDataOBDController {

    @Autowired
    private CyDataOBDService cyDataOBDService;

    @GetMapping("/obdInfo")
    @ResponseBody
    public Object getCaptureInfo(@RequestParam("id") String id) {
        try {
            CyDataOBDInfo cyDataOBDInfos = cyDataOBDService.getOBDInfoByVideoId(id);
            return ResultUtil.success(cyDataOBDInfos);
        } catch (Exception e) {
            e.printStackTrace();
            return ResultUtil.error(0, e.getMessage());
        }
    }
}
